import request from './request'

export function query ({currentPage = 1, perPage = 10, paramName, channel = 'ebj', usageKey} = {}) {
  return request({
    url: '/roleParam/list.do',
    method: 'GET',
    params: {currentPage, perPage, paramName, channel, usageKey}
  })
}

export function create ({
  paramName, paramDesc, dataType, paramOrder, paramCode, usageKey, parentCode, condType, selType, flagEnable, channel = 'ebj', crtId
}) {
  return request({
    url: '/roleParam/add.do',
    method: 'POST',
    body: {paramName, paramDesc, dataType, paramOrder, paramCode, usageKey, parentCode, condType, selType, flagEnable, channel, crtId}
  })
}

export function edit ({
  id, paramName, paramDesc, dataType, paramOrder, paramCode, usageKey, parentCode, condType, selType, flagEnable, updId
}) {
  return request({
    url: '/roleParam/modify.do',
    method: 'POST',
    body: {id, paramName, paramDesc, dataType, paramOrder, paramCode, usageKey, parentCode, condType, selType, flagEnable, updId}
  })
}

export function del (id, paramCode, channel = 'ebj') {
  return request({
    url: '/roleParam/delete.do',
    method: 'POST',
    body: {id, paramCode, channel}
  })
}
